<?php
class Application_Model_Schema_Tile {
	protected $_id;
	protected $_map;
	protected $_x;
	protected $_y;
	protected $_type;
	protected $_resources = array();
	protected $_objects = array();

	public function __set($name, $value) {
		$method = 'set' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Set Invalid Tile Property');
		}
		$this->$method($value);
	}

	public function __get($name) {
		$method = 'get' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Get Invalid Tile Property');
		}
		return $this->$method();
	}

	public function setId($id) {
		$this->_id = (int) $id;
		return $this;
	}

	public function getId() {
		return $this->_id;
	}
	
	public function setMap($map) {
		$this->_map = $map;
		return $this;
	}

	public function getMap() {
		return $this->_map;
	}
	
	public function setX($x) {
		$this->_x = (int) $x;
		return $this;
	}

	public function getX() {
		return $this->_x;
	}	
	
	public function setY($y) {
		$this->_y = (int) $y;
		return $this;
	}

	public function getY() {
		return $this->_y;
	}
	
	public function setType($type) {
		$this->_type = $type;
		return $this;
	}

	public function getType() {
		return $this->_type;
	}
	
	public function setResources($resources) {
		$this->_resources = $resources;
		return $this;
	}
	
	public function setResource($resource) {
		$this->_resources[] = $resource;
		return $this;
	}	

	public function getResources() {
		return $this->_resources;
	}	
	
	public function setObjects($objects) {
		$this->_objects = $objects;
		return $this;
	}
	
	public function setObject($object) {
		$this->_objects[] = $object;
		return $this;
	}	

	public function getObjects() {
		return $this->_objects;
	}	
}
?>